<template>
  <view>
    <view class="content">
      <view class="logo">
        <image src="/static/images/boy.png" class="avatar" />
      </view>
      <view class="name">
        {{ userStore.userInfo.fullName }}
      </view>
      <view class="item" @click="gotoFace">
        <image src="/static/images/setup-face.png" class="pre-logo" />
        <wd-text text="新增教师" color="#333333" size="14px" />
      </view>
      <view class="item" @click="goToBindStudent">
        <image src="/static/images/setup-student.png" class="pre-logo" />
        <wd-text text="绑定学生" color="#333333" size="14px" />
      </view>
      <view class="item">
        <image src="/static/images/setup-config.png" class="pre-logo" />
        <wd-text text="设置" color="#333333" size="14px" />
      </view>
    </view>
  </view>
</template>

<script lang="ts" setup>
import { useUserStore } from "@/store/user";

const userStore = useUserStore();
console.log("userStore.userInfo:", userStore.userInfo);
function goToBindStudent() {
  uni.navigateTo({
    url: `/pages-sub/student/selectSchool?showBack=true`,
  });
}
function gotoFace() {
  uni.navigateTo({
    url: `/pages/me/face`,
  });
}
</script>

<style lang="scss" scoped>
.function-title {
  margin-top: 60px;
  font-size: 12px;
  color: #999999;
  margin-bottom: 20px;
}
.content {
  margin-left: 24px;
}
.pre-logo {
  width: 24px;
  height: 24px;
  margin-right: 20px;
}
.item {
  display: flex;
  align-items: center;
  height: 34px;
  margin-bottom: 11px;
}

.logo {
  margin: 25px 0;
  position: relative;
  display: flex;
  height: 80px;
  width: 100%;
  justify-content: center;
  align-items: center;

  .avatar {
    width: 80px;
    height: 80px;
    background: #e0e0e0;
    border-radius: 40px;
  }
}
.name {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  color: #333333;
}
</style>
